import React, {Component} from 'react';
import {Appearance} from 'react-native';
import {connect} from 'react-redux';
import {
  NavigationContainer,
  DefaultTheme,
  DarkTheme,
} from '@react-navigation/native';
import {createNativeStackNavigator} from '@react-navigation/native-stack';
import {Provider as AntProvider} from '@ant-design/react-native';
import Test from './src/view/test';
import Await from './src/view/await';
import Login from './src/view/login';
import Home from './src/view/home';
import HomePage from './src/view/home-page';
import ArticleDetali from './src/view/article-detali';
import EditUser from './src/view/edit-user';

const colorScheme = Appearance.getColorScheme();
const Stack = createNativeStackNavigator();

class App extends Component {
  constructor(props) {
    super(props);
  }
  render() {
    return (
      <AntProvider>
        <NavigationContainer
          theme={colorScheme === 'dark' ? DarkTheme : DefaultTheme}>
          <Stack.Navigator initialRouteName="Await">
            <Stack.Screen
              name="Await"
              component={Await}
              options={{headerShown: false}}
            />
            <Stack.Screen
              name="Test"
              component={Test}
              options={{headerShown: false}}
            />
            <Stack.Screen
              name="Login"
              component={Login}
              options={{headerShown: false}}
            />
            <Stack.Screen
              name="Home"
              component={Home}
              options={{headerShown: false}}
            />
            <Stack.Screen
              name="HomePage"
              component={HomePage}
              options={{headerShown: false}}
            />
            <Stack.Screen
              name="EditUser"
              component={EditUser}
              options={{headerShown: false}}
            />
            <Stack.Screen
              name="ArticleDetali"
              component={ArticleDetali}
              options={{headerShown: false}}
            />
          </Stack.Navigator>
        </NavigationContainer>
      </AntProvider>
    );
  }
}

const mapStateToProps = () => ({});

const mapDispatchToProps = () => ({});

export default connect(mapStateToProps, mapDispatchToProps)(App);
